﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgNetComponents.Design.Attributes
{
    /// <summary>
    /// Returns BrowsableAttribute
    /// </summary>
    public class HiddenByPropertyValueAttribute : DynamicPropertyAttribute
    {
        /// <summary>
        /// Creates HiddenByPropertyValueAttribute instance
        /// </summary>
        /// <param name="property">Property name</param>
        /// <param name="values">Values for which BrowsableAttribute(false) will be returned</param>
        public HiddenByPropertyValueAttribute(string property, params object[] values) :
            base(property, values)
        {
        }
        /// <summary>
        /// Returns new BrowsableAttribute(!valuesMatch)
        /// </summary>
        /// <param name="valuesMatch"></param>
        /// <returns></returns>
        protected override Attribute GetAttribute(bool valuesMatch)
        {
            return new System.ComponentModel.BrowsableAttribute(!valuesMatch);
        }
    }
}
